from rest_framework import serializers

from goods.models import GoodsSpecification


class GoodsSpecSerializer(serializers.ModelSerializer):

    spu = serializers.StringRelatedField(read_only=True)
    spu_id = serializers.IntegerField()

    class Meta:
        model = GoodsSpecification
        fields = '__all__'


class GoodsSpec2Serializer(serializers.ModelSerializer):
    spu = serializers.StringRelatedField(read_only=True)
    spu_id = serializers.IntegerField()

    class Meta:
        model = GoodsSpecification
        fields = '__all__'